import { createRouter, createWebHistory } from 'vue-router'
import Index from '../views/Index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      component: Index
    },
    {
      path: '/pinia',
      component: ()=>import('@/views/Pinia.vue')
    },
    {
      path:'/kuai',
      //懒加载
      component:()=> import('@/views/Kuai.vue')
    },
    {
      path:'/cart',
      //懒加载
      component:()=> import('@/views/Cart.vue')
    },
    {
      path:'/my',
      //懒加载
      component:()=> import('@/views/ucenter/My.vue')
    },
    {
      path: '/register',
      component: () => import('@/views/ucenter/Register.vue')
    },
    {
      path: '/login',
      component: () => import('@/views/ucenter/Login.vue')
    },
    {
      path:'/search',
      //懒加载
      component:()=> import('@/views/Search.vue')
    },
    {
      path:'/city',
      component:() => import('@/views/City.vue')
    },
    {
      path:'/address',
      component:() => import('@/views/Address.vue')
    }
  ]
})

export default router
